package com.rc.evcharger.service.rc;

import com.rc.evcharger.mapper.rc.RcMemberGainGradeRecordMapper;
import com.rc.evcharger.model.rc.RcMemberGainGradeRecord;
import com.rc.evcharger.model.rc.RcMemberGainGradeRecordExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RcMemberGainGradeRecordServiceImpl implements RcMemberGainGradeRecordService {
    @Autowired
    private RcMemberGainGradeRecordMapper rcMemberGainGradeRecordMapper;

    @Override
    public RcMemberGainGradeRecordMapper getMapper() {
        return rcMemberGainGradeRecordMapper;
    }

    @Override
    public List<RcMemberGainGradeRecord> listCurrentByMemberId(Long memberId) {
        RcMemberGainGradeRecordExample example = new RcMemberGainGradeRecordExample();
        example.createCriteria().andMemberIdEqualTo(memberId);
        example.setOrderByClause("created_time desc");
        return rcMemberGainGradeRecordMapper.selectByExample(example);
    }
}
